import logging,yagmail,yaml
def rizhi():
    logging.basicConfig(filename='rz.txt',filemode='a+',level=logging.INFO,datefmt='%(asctime)s->%(levelnme)s->%(message)')
    a=logging.StreamHandler()
    a.setLevel(logging.INFO)
    b=logging.Formatter()
    a.setFormatter(b)
    c=logging.getLogger()
    c.addHandler(a)


def youjian(filename):
    email=yagmail.SMTP(user='1038995773@qq.com',password='pahznimdvxdtbegi',host="smtp.qq.com")
    email.send(to='1038995773@qq.com',subject='邮件',contents='报告',attachments=filename)

def read(file):
    with open(file, 'r', encoding='utf-8') as e:
        return yaml.safe_load(e)
